<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			* {
				padding: 0;
				margin: 0;
			}
			body,
			html {
				width: 100%;
				height: 100vh;
			}
			img {
				width: 50px;
				height: 50px;
			}
		</style>
	</head>
	<body>
		<script type="module">
			import convertImageToBase64 from "./convertImageToBase64.js";
			import { downloadBase64AsImage } from "./downloadBase64AsImage.js";
			const url = "./IU.png";
			const addImg = async () => {
				const base64UrL = await convertImageToBase64(url);
				console.log("base64UrL", base64UrL);

				const img = new Image();
				img.src = base64UrL;
				document.body.appendChild(img);
				setTimeout(() => {
					downloadBase64AsImage(base64UrL);
				}, 2000);
			};
			addImg();
		</script>
	</body>
</html>
